﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using sdm.exam.domain;
using sdm.exam.domain.Abstract;
using sdm.exam.domain.DataContext;
using sdm.exam.domain.Entities;

namespace sdm.exam.test.Manager
{
    [TestClass]
    public class EducationManagerTest
    {
        /// <summary>
        /// Tests whether or not we are getting a list of educations.
        /// </summary>
        [TestMethod]
        public void GetListOfEducationsTest()
        {
            Ninjector.Kernel.Bind<ISdmExamRepository>().ToConstant(new DataContext(ConnectionStrings.TestConnection));
            var manager = new sdm.exam.domain.Manager.EducationManager();

            List<domain.Entities.Education> educationList = manager.GetListOfEducations();

            Assert.IsNotNull(educationList);
        }

        /// <summary>
        /// Tests whether or not we get a specific education according to a specific id.
        /// </summary>
        [TestMethod]
        public void GetEducationByIdTest()
        {
            Ninjector.Kernel.Bind<ISdmExamRepository>().ToConstant(new DataContext(ConnectionStrings.TestConnection));
            var manager = new sdm.exam.domain.Manager.EducationManager();

            const int id = 36;
            Education edu = manager.GetEducationById(id);
            Assert.AreEqual(id, edu.Id);
        }
    }
}
